<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../Template/generalTemplate.xhtml">


            <ui:define name="content">
                
                <h:form id="form2" prependId="false">
                  <p:panel id="inquiry" header="New Sales Inquiry" style="height:495px;">
                    <div style="margin-top:80px;margin-left:200px;">
                      <h:panelGrid id="grid" columns="3">
                        
                        <h:outputText value="Choose A Company:" />
                        <h:selectOneMenu id="companyId" value="#{testGetCompany.selectedCompany.name}" required="true" requiredMessage="Company Cannot be Blank" >
                            <f:selectItem itemLabel="Select Company..." itemValue="" />
                            <f:selectItems value="#{testGetCompany.getCompanyNames()}" var="getCompanies" itemLabel="#{testGetCompany.selectedCompany.name}" itemValue="#{testGetCompany.selectedCompany.name}" />
                        </h:selectOneMenu>
                        <p:message for="companyId" />

                        <h:outputText value="Classic Nutri Bar-Nuts (in cases):" />
                        <p:inputText  id="quantityA" value="#{createNewInquiryManagedBean.quantity1}" />
                        <p:message for="quantityA" />

                        <h:outputText value="Classic Nutri Bar-Fruits (in cases):" />
                        <p:inputText  id="quantityB" value="#{createNewInquiryManagedBean.quantity2}" />
                        <p:message for="quantityB" />

                        <h:outputText value="Premium Power Bar-Chocolate Nuts (in cases):" />
                        <p:inputText  id="quantityC" value="#{createNewInquiryManagedBean.quantity3}" />
                        <p:message for="quantityC" />

                        <h:outputText value="Premium Power Bar-Redcurrant Fruits (in cases):" />
                        <p:inputText  id="quantityD" value="#{createNewInquiryManagedBean.quantity4}" />
                        <p:message for="quantityD" />

                        <p:commandButton value="Create"  ajax="false"  update="companyId" actionListener="#{createNewInquiryManagedBean.saveInquiry}">
                            <f:attribute name="companySelected" value="#{testGetCompany.selectedCompany.name}"/>
                        </p:commandButton>
                      
                      </h:panelGrid>
                    </div>
                  </p:panel>
                </h:form>
            </ui:define>
            
            

        </ui:composition>

    </body>
</html>
